package com.cirkana.viewer.location;

import java.io.DataInputStream;
import java.io.DataOutputStream;

import com.cirkana.serial.SerializablePassData;
import com.cirkana.serial.SerializationException;

public class ChangeProviderPassData extends SerializablePassData {

	private String locationProvider;

	public void setLocationProvider(String locationProvider) {
		this.locationProvider = locationProvider;
	}

	public String getLocationProvider() {
		return locationProvider;
	}

	public ChangeProviderPassData() {
	}

	public ChangeProviderPassData(String locationProvider) {
		this.locationProvider = locationProvider;
	}

	@Override
	public void serialize(DataOutputStream out) throws SerializationException {
		serializeString(this.locationProvider, out);
	}

	@Override
	public void deserialize(DataInputStream in) throws SerializationException {
		this.locationProvider = deserializeString(in);
	}

	@Override
	public String toString() {
		StringBuilder s = new StringBuilder("{");

		s.append("locationProvider=");
		if (this.locationProvider == null)
			s.append("(null)");
		else
			s.append(this.locationProvider);
		s.append("}");

		return s.toString();
	}
}
